package com.zzyl.controller.customer;


import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.controller.LoginController;
import com.zzyl.dto.UserLoginRequestDto;
import com.zzyl.service.CustomerUserService;
import com.zzyl.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/user")
@Api(tags = "用户管理")
@Slf4j
public class CustomerUserController extends BaseController {

    @Autowired
    CustomerUserService customerUserService;


    /**
     * C端用户登录--微信登录
     * @param userLoginRequestDto 用户登录信息
     * @return 登录结果
     */
    @PostMapping("/login")
    @ApiOperation("小程序端登录")
    public ResponseResult<LoginVo> login(@RequestBody UserLoginRequestDto userLoginRequestDto){


        LoginVo loginVo = customerUserService.login(userLoginRequestDto);

        return ResponseResult.success(loginVo);
    }




}
